﻿namespace NEvoWeb.Modules.NB_Store
{
    using Microsoft.VisualBasic;
    using Microsoft.VisualBasic.CompilerServices;
    using System;

    public class NB_Store_OrdersInfo
    {
        private decimal _AlreadyPaid;
        private decimal _AppliedTax;
        private string _BankAuthCode;
        private int _BillingAddressID;
        private decimal _CalculatedTax;
        private string _CartXMLInfo;
        private decimal _Discount;
        private DateTime _ElapsedDate;
        private string _Email;
        private string _GatewayProvider;
        private string _NoteMsg;
        private DateTime _OrderDate;
        private string _OrderGUID;
        private int _OrderID;
        private bool _OrderIsPlaced = false;
        private string _OrderNumber = "";
        private int _OrderStatusID;
        private string _PayType;
        private int _PortalID;
        private string _PromoCode;
        private string _Referrer;
        private DateTime _ShipDate;
        private int _ShipMethodID;
        private int _ShippingAddressID;
        private decimal _ShippingCost;
        private string _Stg2FormXML;
        private string _Stg3FormXML;
        private decimal _Total;
        private string _TrackingCode;
        private int _UserID;
        private string _VATNumber;

        public decimal AlreadyPaid
        {
            get
            {
                return this._AlreadyPaid;
            }
            set
            {
                this._AlreadyPaid = value;
            }
        }

        public decimal AppliedTax
        {
            get
            {
                return this._AppliedTax;
            }
            set
            {
                this._AppliedTax = value;
            }
        }

        public decimal BalanceOutstanding
        {
            get
            {
                decimal num=0;
                try
                {
                    num = decimal.Subtract(this._Total, this._AlreadyPaid);
                }
                catch (Exception exception1)
                {
                    ProjectData.SetProjectError(exception1);
                    Exception exception = exception1;
                    num = this._Total;
                    ProjectData.ClearProjectError();
                }
                return num;
            }
        }

        public string BankAuthCode
        {
            get
            {
                return this._BankAuthCode;
            }
            set
            {
                this._BankAuthCode = value;
            }
        }

        public int BillingAddressID
        {
            get
            {
                return this._BillingAddressID;
            }
            set
            {
                this._BillingAddressID = value;
            }
        }

        public decimal CalculatedTax
        {
            get
            {
                return this._CalculatedTax;
            }
            set
            {
                this._CalculatedTax = value;
            }
        }

        public decimal CartTotal
        {
            get
            {
                return decimal.Subtract(this._Total, decimal.Add(this._ShippingCost, this._AppliedTax));
            }
        }

        public decimal CartTotalPlusShipping
        {
            get
            {
                return decimal.Add(this._Total, this._ShippingCost);
            }
        }

        public string CartXMLInfo
        {
            get
            {
                return this._CartXMLInfo;
            }
            set
            {
                this._CartXMLInfo = value;
            }
        }

        public decimal Discount
        {
            get
            {
                return this._Discount;
            }
            set
            {
                this._Discount = value;
            }
        }

        public DateTime ElapsedDate
        {
            get
            {
                return this._ElapsedDate;
            }
            set
            {
                this._ElapsedDate = value;
            }
        }

        public string Email
        {
            get
            {
                return this._Email;
            }
            set
            {
                this._Email = value;
            }
        }

        public string GatewayProvider
        {
            get
            {
                return this._GatewayProvider;
            }
            set
            {
                this._GatewayProvider = value;
            }
        }

        public string NoteMsg
        {
            get
            {
                return this._NoteMsg;
            }
            set
            {
                this._NoteMsg = value;
            }
        }

        public DateTime OrderDate
        {
            get
            {
                return this._OrderDate;
            }
            set
            {
                this._OrderDate = value;
            }
        }

        public string OrderGUID
        {
            get
            {
                return this._OrderGUID;
            }
            set
            {
                this._OrderGUID = value;
            }
        }

        public int OrderID
        {
            get
            {
                return this._OrderID;
            }
            set
            {
                this._OrderID = value;
            }
        }

        public bool OrderIsPlaced
        {
            get
            {
                return this._OrderIsPlaced;
            }
            set
            {
                this._OrderIsPlaced = value;
            }
        }

        public string OrderNumber
        {
            get
            {
                return this._OrderNumber;
            }
            set
            {
                this._OrderNumber = value;
            }
        }

        public int OrderStatusID
        {
            get
            {
                return this._OrderStatusID;
            }
            set
            {
                this._OrderStatusID = value;
            }
        }

        public string PayType
        {
            get
            {
                return this._PayType;
            }
            set
            {
                this._PayType = value;
            }
        }

        public int PortalID
        {
            get
            {
                return this._PortalID;
            }
            set
            {
                this._PortalID = value;
            }
        }

        public string PromoCode
        {
            get
            {
                return this._PromoCode;
            }
            set
            {
                this._PromoCode = value;
            }
        }

        public string Referrer
        {
            get
            {
                return this._Referrer;
            }
            set
            {
                this._Referrer = value;
            }
        }

        public DateTime ShipDate
        {
            get
            {
                return this._ShipDate;
            }
            set
            {
                this._ShipDate = value;
            }
        }

        public int ShipMethodID
        {
            get
            {
                return this._ShipMethodID;
            }
            set
            {
                this._ShipMethodID = value;
            }
        }

        public int ShippingAddressID
        {
            get
            {
                return this._ShippingAddressID;
            }
            set
            {
                this._ShippingAddressID = value;
            }
        }

        public decimal ShippingCost
        {
            get
            {
                return this._ShippingCost;
            }
            set
            {
                this._ShippingCost = value;
            }
        }

        public string ShortOrderNumber
        {
            get
            {
                if (this._OrderNumber.Length > 14)
                {
                    return this._OrderNumber.Substring(Strings.InStr(this._OrderNumber, "-", CompareMethod.Binary) + 6, 5);
                }
                return "";
            }
        }

        public string Stg2FormXML
        {
            get
            {
                return this._Stg2FormXML;
            }
            set
            {
                this._Stg2FormXML = value;
            }
        }

        public string Stg3FormXML
        {
            get
            {
                return this._Stg3FormXML;
            }
            set
            {
                this._Stg3FormXML = value;
            }
        }

        public decimal Tax
        {
            get
            {
                if (decimal.Compare(this._AppliedTax, decimal.Zero) == 0)
                {
                    return this._CalculatedTax;
                }
                return this._AppliedTax;
            }
        }

        public decimal Total
        {
            get
            {
                return this._Total;
            }
            set
            {
                this._Total = value;
            }
        }

        public string TrackingCode
        {
            get
            {
                return this._TrackingCode;
            }
            set
            {
                this._TrackingCode = value;
            }
        }

        public int UserID
        {
            get
            {
                return this._UserID;
            }
            set
            {
                this._UserID = value;
            }
        }

        public string VATNumber
        {
            get
            {
                return this._VATNumber;
            }
            set
            {
                this._VATNumber = value;
            }
        }
    }
}

